package com.ingrun.tuboshu.utils;

import cn.hutool.core.util.IdUtil;
import lombok.Getter;

@Getter
public class ResponseException extends RuntimeException {

    private final ResponseEnum responseEnum;
    private final String errorId;

    public ResponseException(ResponseEnum responseEnum) {
        super(responseEnum.getMessage());
        this.responseEnum = responseEnum;
        this.errorId = IdUtil.fastUUID();
    }

    public ResponseException(ResponseEnum responseEnum, String message) {
        super(message);
        this.responseEnum = responseEnum;
        this.errorId = IdUtil.fastUUID();
    }

}
